#{extends 'mainFMPA.html' /}#{set title:'Modification de la FMPA' /}
<style type="text/css"> 
@import "../../../public/javascripts/jquery-ui-1.8.13.custom/css/ui-lightness/jquery-ui-1.8.13.custom.css";
</style>
<script type="text/javascript" src="../../../public/javascripts/jquery-ui-1.8.13.custom/js/jquery-ui-1.8.13.custom.min.js"></script>
<script type="text/javascript" src="../../../public/javascripts/jquery-ui-1.8.13.custom/development-bundle/ui/i18n/jquery.ui.datepicker-fr.js"></script>

<SCRIPT>
	$(function() {
		$( "#date" ).datepicker();
	});
</SCRIPT>

<SCRIPT LANGUAGE="JavaScript">
	$(document).ready(function() {
		$('#aModifier').load("/sequencesCoche/"+${fmpaQ.id}+"&"+${fmpaQ.annee})
	} );
</SCRIPT>

<h1 style="width:400px;">Modifier la FMPA</h1>
<div id="detail_fmpa">
#{form @modifFMPA()}
    <p>
 	    <label for="cis" id="cis">CIS :</label>
        #{select 'cis', items:centres, id:'cis', valueProperty:'id', value:idCis}
        #{/select}
    </p>
    <p>
        <label for="date">Date :</label>
        <input type="text" name="date" id="date" value="${date}" />
    <p>
    <p>
        <label for="annee">Ann&eacute;e de prise en compte :</label>
        <input type="text" name="annee" id="annee" value="${fmpaQ.annee}" onChange="change()"/>
    </p>
    <p>
 	    <label for="description">Description :</label>
    	<textarea name="description" id="description" >${fmpaQ.fmpa.description}</textarea>
        
    </p>
    <p id="aModifier">
    </p>
    <p>
 	    <label for="duree">Dur&eacute;e :</label>
        #{select 'duree', items:durees, id:'duree', valueProperty:'id', value:idDuree}
        #{/select}
    </p>
    <p>
       	<label for="observation">Observation :</label>
    	<textarea name="observation" id="observation" >${fmpaQ.fmpa.observation}</textarea>
    </p>
    <p>
	<input type="hidden" name="thematique" value=${fmpaQ.fmpa.thematique.id} >
	<input type="hidden" name="fmpa" value=${fmpaQ.id} >
    <p style="margin-top:30px">    
        <input type="submit" value="Enregistrer les modifications" />
        <input type="button" onClick="self.location.href='@{FMPAQuinquennals.detailFMPA(fmpaQ.id)}'" value="retour" />
    </p>
#{/form}
</div>

<SCRIPT type="text/javascript">
	function change(){
	    var monAnnee=document.getElementById("annee").value
	    $('#aModifier').load("/sequencesCoche/"+${fmpaQ.id}+"&"+monAnnee)
	}
</SCRIPT>